package cn.com.pureAppApi.dao;

import cn.com.pureAppApi.entity.NewsEntity;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.BaseMapper;
/**
 * InnoDB free: 10240 kB
 * 
 * QQ讨论群:76989293
 * @email 2696701142@qq.com
 * @date 2018-06-12 16:51:48
 */
@Mapper
public interface NewsMapper extends BaseMapper<NewsEntity> {
	
		/**
	 * 根据Parameter查找返回对象
	 * @param Parameter
	 * @return
	 */
		@Select(" SELECT  id ,   user_id ,   title ,   img ,   content ,   datetime   FROM app_news WHERE id = #{id}")
		NewsEntity findEntityGet(@Param("id") Integer id);
	
	/**
	 * 根据Parameter查找返回List
	 * @param Parameter
	 * @return
	 */
 		@Select(" SELECT  id ,   user_id ,   title ,   img ,   content ,   datetime   FROM app_news WHERE id = #{id}")
		List<NewsEntity> findEntityListByParameter(@Param("id") Integer id);
	

}
